from core.basehandler import BaseHandler
from core.room import Room
from items.beverage import beverage
from core.action import Action
from core.support import set_cutscene

class entrancehall(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # add inventory items
        self.add_item(beverage())
        
        # build list of actions
        self.add_action(goin)
        self.add_action(getcard)
    
    # return description of room.
    def get_description(self):
        return "Bienvenue to the wedding reception....it's time to party. Grab a random seating card and start doing some recon. A penguin-suited waiter offers you a tasty beverage from his tray... do you accept?"
    
    # return image of room
    def get_image(self):
        return 'enterancehall.jpg'


class EntranceHallHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return entrancehall

# define actions for this room

class goin(Action):
    def __init__(self):
        Action.__init__(self, "goin")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go in to Reception"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'loserroom'
    
    def do_action(self,game,room,request):
        set_cutscene("You idiot! You didn't get a place card! Try again.")
        return
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
class getcard(Action):
    def __init__(self):
        Action.__init__(self, "getcard")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Grab a Place Card"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'entrancehall2'
    
    def do_action(self,game,room,request):
        set_cutscene("You select a name card reading Walex Agenheim (the Sausage King of Baltimore), since that guy NEVER shows up.")
        return
    
